//
//  UIView+Corner.m
//  weather
//
//  Created by super on 2021/8/31.
//

#import "UIView+Corner.h"

@implementation UIView (Corner)
- (void)addCorner:(UIRectCorner)corner radius:(CGFloat)radius{
    
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corner
    cornerRadii:CGSizeMake(radius, radius)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
    // 设置大小
    maskLayer.frame = self.bounds;
    // 设置图形样子
    maskLayer.path = maskPath.CGPath;
    self.layer.mask = maskLayer;
}
@end
